import React, { useEffect } from 'react';
import { TimePicker } from 'antd';

export default function TimeRange({
  options,
  value,
  defaultValue,
  onHandleChange,
  onChange,
  ...props
}) {
  useEffect(() => {
    onChange(value || defaultValue);
  }, []);
  const handleChange = (e) => {
    console.log(e);
    onChange(e);
    onHandleChange?.(e);
  };
  return (
    <TimePicker.RangePicker
      value={value}
      onChange={(value) => handleChange(value)}
      style={{ width: '100%' }}
      {...props}
    />
  );
}
